document.addEventListener('DOMContentLoaded', function() {
    const projectList = document.getElementById('project-list');

    chrome.runtime.sendMessage({ action: 'getProject' }, (response) => {
        if (response.project) {
            const project = response.project;
            const projectDiv = document.createElement('div');
            projectDiv.className = 'project';
            projectDiv.innerHTML = `
                <strong>项目ID:</strong> ${project.id}<br>
                <strong>模块分类:</strong> ${project.module_category}<br>
                <strong>模块地址:</strong> <a href="${project.module_url}" target="_blank">${project.module_url}</a><br>
                <strong>权限:</strong> ${project.permissions.join(', ')}<br>
                <strong>产品代码:</strong> ${project.product_code}<br>
                <strong>编译序号:</strong> ${project.serial_number}<br>
            `;
            projectList.appendChild(projectDiv);
        } else {
            projectList.innerHTML = '<p>没有项目数据</p>';
        }
    });
}); 